package behavioralPattern.chain_of_responsibility.example03;

import behavioralPattern.chain_of_responsibility.example02.AuthInfo;
import lombok.Data;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 抽象处理者
 */
@Data
public abstract class AuthLink {

    protected SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");

    protected String levelUserId; // 审核人id

    protected String levelUserName; // 审核人姓名

    protected AuthLink next; // 下一步

    public AuthLink(String levelUserId, String levelUserName) {
        this.levelUserId = levelUserId;
        this.levelUserName = levelUserName;
    }

    // 添加处理者
    public AuthLink appendNext(AuthLink authLink){
        this.next = authLink;
        return this;
    }

    // 抽象审核方法
    public abstract AuthInfo doAuth(String uId, String orderId, Date authDate);

}
